Skip to content

fix(relay): preserve multi-channel workflow queries#2350

Draft
JayFarei wants to merge 2 commits into
block:mainfrom
JayFarei:fix/agent-owned-workflow-visibility
Draft

fix(relay): preserve multi-channel workflow queries#2350
JayFarei wants to merge 2 commits into
block:mainfrom
JayFarei:fix/agent-owned-workflow-visibility

Conversation

@JayFarei

Copy link
Copy Markdown

What changed

  • Stop collapsing a multi-channel #h filter into a single channel predicate.
  • Intersect explicitly requested channels with the caller's accessible channels before the SQL limit is applied.
  • Add regressions for multi-channel extraction and access scoping.

Why

Desktop batches the Workflows overview into one Nostr filter containing every member channel. The HTTP relay bridge previously selected one #h value for SQL pushdown, so workflows in every other requested channel were filtered out. A broad fallback alone was also insufficient because unrelated accessible-channel rows could consume the query limit before requested rows reached Nostr post-filtering.

This made valid workflows invisible in Desktop even though direct single-channel workflow queries could retrieve them.

User impact

The Workflows overview can list workflows across all accessible channels in one request, including workflows created by agents in DMs. Single-channel queries keep their existing fast path.

Validation

  • cargo fmt --all -- --check
  • cargo clippy -p buzz-relay --all-targets -- -D warnings
  • cargo test -p buzz-relay --lib -- --skip api::mesh_demo::tests::demo_join_forwarded_arm_round_trips_echo — 717 passed, 23 ignored, 1 filtered out
  • ./scripts/check-branch-skew.sh

The unfiltered relay package run had one unrelated existing failure: api::mesh_demo::tests::demo_join_forwarded_arm_round_trips_echo returned 504 instead of 200. All changed request-filter tests passed.

JayFarei added 2 commits July 22, 2026 10:56
Avoid pushing a single channel predicate when a Nostr filter contains multiple #h values, so batched Desktop workflow listings retain every accessible channel.

Co-authored-by: jayfarei <fareiunastrage@gmail.com>
Signed-off-by: jayfarei <fareiunastrage@gmail.com>
Intersect explicit multi-channel filters with the caller's accessible channels before SQL LIMIT so unrelated channel rows cannot hide requested workflows.

Co-authored-by: jayfarei <fareiunastrage@gmail.com>
Signed-off-by: jayfarei <fareiunastrage@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant